python连接redis
1.python连接redis
from django.test import TestCase import redis
conn = redis.Redis(host='127.0.0.1') conn.set('key1', 'v1') conn.hset('n2', 'k2', 'v2') print(conn.get('key1'))
人生就是要不断折腾
1.python连接redis
from django.test import TestCase import redis
conn = redis.Redis(host='127.0.0.1') conn.set('key1', 'v1') conn.hset('n2', 'k2', 'v2') print(conn.get('key1'))